<?php
include("header.tpl.php");
?>

<div id="left">
	<div id="banner" class="clearfix">
        <?php if (user_is_logged_in() == true){ ?>
			<div id="myaccount">
				<?php
					include_once drupal_get_path('module', 'user') . '/user.pages.inc';
					global $user;
					$profile =  profile_load_profile($user);
					print "<div class='profile'>";
					print "<div style='float:left'>";
					print "<b>Welcome!</b><br />";
					print l($user->name,"user/$user->uid")."&nbsp;&nbsp;&nbsp;&nbsp;(<a href=\"/suomikiina/logout\">Log out</a>)";
					print "<br /><br /><b>E-mail address</b><br />";
					print $user->mail;
					print "<br /><br /><b>Institute</b><br />";
					print $user->profile_institute;
					print "<br /><br /><b>Position</b><br />";
					print $user->profile_position;
					print "</div><div style='float:right'>";
					if($user->picture){
						print "<img src=\"".$base_url."/".$user->picture."\" alt=\"".$user->name."\" />";
					}
					else {
						print "<img src=\"".$base_url."/sites/default/files/pictures/0.gif\" alt=\"".$user->name."\" />";
					}
					print "</div>";
					print "</div>";
					//print user_view($user);
				?>
        	</div>
		<?php }
        else { 
		?>
        	<div id="login">
				<?php print drupal_get_form('user_login_block'); ?>
        	</div>
        <?php } ?>
	</div><!--banner-->
</div><!--left-->
    <?php include("right.tpl.php") ?>
</div><!-- /wrapper-->

<?php include("footer.tpl.php") ?>